<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var array1 = new Array(7);
        console.log(array1.length);
        var array2 = new Array(100, 'abc', true);
        console.log(array2.length);
        console.log(array2[1]);

        //构造一个空数组
        var array = new Array();
        array[0] = '123';
        console.log(array);
        console.log(array.length);
        array[1] = false;
        console.log(array);
        console.log(array.length);

        var arr = new Array();
        arr.push('zhangsan');
        console.log(arr);//['zhangsan']
        console.log(arr.length);//1
        arr.push(false);
        console.log(arr);//['zhangsan', false]
        console.log(arr.length);//2
        arr.push(23);
        console.log(arr);//['zhangsan', false, 23]
        console.log(arr.length);//3
        console.log(arr.pop());//23
        console.log(arr.pop());//flase
        console.log(arr.pop());//zhangsan

    </script>
</body>
</html>